<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    <!--    <link rel="stylesheet" th:href="@{/bootstrap/css/index.css}">-->
    <link th:href="@{/style/style.css}" rel="stylesheet"/>
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<!-- main div -->
<div class="main-w3layouts wrapper">
    <div class="main-agileinfo">
        <div class="agileits-top">
            <!--向何处发送表单数据。
                可能的值：
                    绝对 URL - 指向其他站点（比如 src="www.example.com/example.htm"）
                    相对 URL - 指向站点内的文件（比如 src="example.htm"）
            -->
            <form action="/login/getregister" method="post">
                <input class="layui-form-text" type="text" name="username" placeholder="请用手机号注册" required  lay-verify="required" autocomplete="off">
                <input class="layui-form-text" type="text" name="nickname" placeholder="取个响亮的名字吧" required  lay-verify="required" autocomplete="off">
                <input class="layui-form-text" type="password" name="password" placeholder="请输入密码" required  lay-verify="required" autocomplete="off">
                <!--<input class="layui-form-text" type="surepassword" name="surepassword" placeholder="确认密码">-->
                <input type="submit" value="注册" id="register">
            </form>
            <p th:text="${str}"></p>
            <p th:text="${str1}"></p>
            <a th:href="@{/login/}"><p>立即登录!</p></a>
        </div>
    </div>
</div>
<!-- /main div -->
<script>
    $(function () {
        $("register").click(function () {
            var password= $("#password").val();
            var surepassword =$("#surepassword").val();
            if(password!=surepassword){
                alert("请输确认密码");
                return false;
            }

        })
    })

</script>
<script src="./layui/lay/modules/layer.js" charset="utf-8"></script>
<script src="./layui/layui.js"></script>
<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;
        //监听提交
        form.on('submit(register)', function(data){
            layer.msg(JSON.stringify(data.field));
            return false;
        });
    });
</script>
</body>
</html>